#include"calib_Program.h"
using namespace cabil;
int main()
{
	int number = 0;
	int value = 0;
	Mat img;
	VideoCapture capture;
	char buffer[30];
	capture.open(0);
	capture.set(CV_CAP_PROP_FRAME_WIDTH,640);
	capture.set(CV_CAP_PROP_FRAME_HEIGHT,480);
	while (1)
	{
		capture >> img;
		imshow("tup",img);
		value = cvWaitKey(10);
		if (value == 'q'||number>12)break;
		else if (value == 't'){
			sprintf_s(buffer,"image//%d.bmp",number);
			printf(buffer);
			cout << endl;
			number++;
			imwrite(buffer,img);
		}
	}


	Presetpara presetpara;
	presetpara.imagewidth = 640;
	presetpara.imageheight = 480;
	presetpara.boardheigt = 5;
	presetpara.boardwidth = 7;
	presetpara.framenumber = 10;
	presetpara.squaresize = 30;
	presetpara.boardcorner = presetpara.boardwidth*presetpara.boardheigt;
	presetpara.boardsize = Size(presetpara.boardwidth, presetpara.boardheigt);
	cabilstart(presetpara, true);
	return 0;
}
//上面的那些代码进行标定，得出来的参数会不正确，好像整个过程都没有错误。所以后来使用了opencv1里的相机标定代码，其见这个工程下面的
//new_main.cpp文件。